
var UserPage = {
	'onQuerySucc':function(data, xhr, status) {
		// MsgBox.info(JSON.stringify(data));
	},
	'queryByCondition':function() {
		datatable.refresh();
	},
	'onItemClick':function(index,item) {
		// MsgBox.info("=>index = " + index + ", item = " + JSON.stringify(item));
	},
	'onDoubleClick':function(index,item) {
		// MsgBox.info("=>index = " + index + ", item = " + JSON.stringify(item));
	},
	'afterSort':function(key, sortState) {
		// MsgBox.info("=>key = " + key + ", sortState = " + sortState);
	},
	'afterReady':function(data) {
		// MsgBox.info("after ready => " + JSON.stringify(data));
	},
	'onRenderItem':function(colName,text,indexStr,mItem) {
		switch(colName) {
		case 'userState':
			text = text == '1' ? $('<span class="m-color-dark-green">正常</span>') :$('<span class="m-color-dark-red">禁用</span>');
			return text;
		}
	},
	'openUserAddDialog':function() {
		MsgBox.open("userAdd", "新增用户", ctx + "/sys/user/add/index", '780px');
	},
	'updateUser':function(item, e) {
		var userId = item.userId;
		MsgBox.open("userUpdate", "修改用户", ctx + "/sys/user/update/index/" + userId, "780px");
	},
	'resetUserPwd':function(item,e) {
		var userId = item.userId;
		resetPwdAjax.tempUrl(function(url) {
			return url + "/" + userId;
		});
		resetPwdAjax.send();
	}
};



